package delta;

import java.util.ArrayList;
import java.util.Random;

public class Road extends Field {
	Random r = new Random();
	private Integer distance;
	private ArrayList<Road> nextRoads;

	public Road() {
		super();
		nextRoads = new ArrayList<Road>();
		distance=0;
	}

	public Road getNextRandomRoad() {
		if(nextRoads.isEmpty())return null;
		
		return nextRoads.get(r.nextInt(nextRoads.size()));
	}

	public Road getNextRoad(int i) {
		if(nextRoads.isEmpty())return null;
		
		return nextRoads.get(i);
	}
	
	public ArrayList<Road> getNextRoads() {
		return nextRoads;
	}

	public Integer getDistance() {
		return distance;
	}

	public void addNextRoad(Road road) {
		if(!nextRoads.contains(road))nextRoads.add(road);
	}
	
	public void setDistance(Integer i) {
		distance = i;
	}
}
